/**
 * 项目配置文件
 * 硬编码配置，无需环境变量
 */

export const config = {
  // 高德地图配置
  amap: {
    key: 'e22cfe1f62423664bb8b6f9b533ed798',
    version: '2.0',
    plugins: ['AMap.Walking', 'AMap.Driving', 'AMap.PlaceSearch'],
    loca: {
      version: '2.0.0'
    }
  },

  // API 配置
  api: {
    baseUrl: 'https://api.zhihunyun.xyz/v1', // 主服务API (Node.js Express)
    aiBaseUrl: 'https://api.zhihunyun.xyz', // AI服务API (Python FastAPI)
    livenessBaseUrl: 'https://api.zhihunyun.xyz', // 活体检测和认证服务
    websocketUrl: 'wss://api.zhihunyun.xyz',
    timeout: 120000 // 2分钟超时
  },

  // 地图默认配置
  map: {
    defaultCenter: [120.1551, 30.2741] as [number, number], // 杭州坐标
    defaultZoom: 16,
    style: 'amap://styles/grey',
    viewMode: '3D',
    pitch: 45,
    rotation: 45,
    features: ['bg', 'building']
  },

  // 3D 场景配置
  scene: {
    backgroundColor: null, // 透明背景
    shadowMapEnabled: true,
    shadowMapType: 'PCFSoftShadowMap',
    ambientLightColor: 0x404040,
    ambientLightIntensity: 0.6,
    directionalLightColor: 0xffffff,
    directionalLightIntensity: 0.8,
    directionalLightPosition: [100, 100, 50]
  },

  // 医院相关配置
  hospital: {
    defaultFloors: ['B2', 'B1', 'L1', 'L2', 'L3', 'L4', 'L5'],
    poiTypes: {
      department: '科室',
      equipment: '设备',
      entrance: '入口',
      elevator: '电梯',
      stairs: '楼梯',
      toilet: '卫生间',
      emergency: '急救'
    },
    poiColors: {
      department: '#3b82f6',
      equipment: '#f59e0b',
      entrance: '#10b981',
      elevator: '#8b5cf6',
      stairs: '#6b7280',
      toilet: '#06b6d4',
      emergency: '#ef4444'
    }
  },

  // AI 助手配置
  ai: {
    responseDelay: 1000, // 模拟AI响应延迟
    maxHistoryMessages: 50,
    supportedIntents: ['navigation', 'appointment', 'shopping', 'promotion'],
    departments: [
      { name: '急诊科', location: { lng: 120.1551, lat: 30.2741 }, floor: 'L1' },
      { name: '内科', location: { lng: 120.1552, lat: 30.2742 }, floor: 'L2' },
      { name: '外科', location: { lng: 120.1553, lat: 30.2743 }, floor: 'L3' },
      { name: '儿科', location: { lng: 120.1554, lat: 30.2744 }, floor: 'L2' },
      { name: '妇产科', location: { lng: 120.1555, lat: 30.2745 }, floor: 'L4' },
      { name: '眼科', location: { lng: 120.1556, lat: 30.2746 }, floor: 'L3' },
      { name: '耳鼻喉科', location: { lng: 120.1557, lat: 30.2747 }, floor: 'L3' },
      { name: '皮肤科', location: { lng: 120.1558, lat: 30.2748 }, floor: 'L2' }
    ]
  },

  // 数据库配置
  database: {
    name: 'HospitalDigitalTwin',
    version: 1,
    tables: ['hospitals', 'floors', 'pois', 'scenarios', 'simulations', 'assets']
  },

  // 性能配置
  performance: {
    maxMarkersPerLevel: 100, // 每层最大标记数
    renderDistance: 1000, // 渲染距离
    lodEnabled: true, // 启用LOD
    webglAntialias: true
  },

  // 调试配置
  debug: {
    enabled: process.env.NODE_ENV === 'development',
    showCoordinates: true,
    showAxesHelper: true,
    logLevel: 'info'
  }
}

// 导出常用配置
export const AMAP_KEY = config.amap.key
export const API_BASE_URL = config.api.baseUrl
export const AI_BASE_URL = config.api.aiBaseUrl
export const LIVENESS_BASE_URL = config.api.livenessBaseUrl
export const DEFAULT_CENTER = config.map.defaultCenter
export const DEFAULT_ZOOM = config.map.defaultZoom

// 类型定义
export type Config = typeof config
export type POIType = keyof typeof config.hospital.poiTypes
export type MapCenter = typeof config.map.defaultCenter